var mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');

var schema = new mongoose.Schema({
    cateId : mongoose.Schema.ObjectId,
    title  : String,
    content: String,
    author: String,
    date:{type: Date,default: Date.now},
    key:String,
    type:String,
    length:String,
    hot:Boolean,
    remark:String,
    number: { type: Number,default:0}
 });
schema.plugin(mongoosePaginate);

module.exports = mongoose.model('News',  schema);  // Model.paginate()